<template>
	<view >
		<view v-for="image in imageList" :key="image" style="margin-bottom: 12rpx;" @click="previewImage(image)">
			<image :src="image" mode="widthFix" style="width: 100vw;border-radius: 12rpx;" />
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				imageList: []				
			}
		},
		methods: {
			previewImage(image) {
				uni.previewImage({
					urls: this.imageList,
					current: image
				})
			}
		},
		onLoad(options) {
			if (options.id) {
				this.$api.qualityInspection.read(options.id).then(res => {
					if (!res) return
					if (res.images) {
						this.imageList = res.images.split(',').filter(item => item)
					}
				}).finally(() => {
					uni.hideLoading();
				})
			}
		}
	}
</script>

<style>

</style>
